/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cliente.auxiliar;

import cliente.domain.Status;
import cliente.domain.User;
import java.util.ArrayList;

/**
 *
 * @author ziza
 */
public class Arquivo {

    private String nickname = null;
    private String password = null;
    private boolean log_ok = false;
    private User [] pesquisa = null;
    private String [] nomes = null;
    private String [] followers = null;
    private Status [] tweets = null;
    private String [] perfil = null;
    private String [] following = null;
    private String follow = null, delete = null;
    private Status [] listaTweets = null;
    private boolean erro = false;
    private ArrayList<String> backup = null;
    private String token = null;
    private String tokenSecret = null;

    public Arquivo() {
    }

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET e SET

    public String[] getNomes() {
        return nomes;
    }

    public void setNomes(String[] nomes) {
        this.nomes = nomes;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        System.out.println("password alterada!"+password);
        this.password = password;
    }

    public String getDelete() {
        return delete;
    }

    public void setDelete(String delete) {
        this.delete = delete;
    }

    public String getFollow() {
        return follow;
    }

    public void setFollow(String follow) {
        this.follow = follow;
    }

    public String [] getFollowers() {
        return followers;
    }

    public void setFollowers(String [] followers) {
        this.followers = followers;
    }

    public String [] getFollowing() {
        return following;
    }

    public void setFollowing(String [] following) {
        this.following = following;
    }

    public String [] getPerfil() {
        return perfil;
    }

    public void setPerfil(String [] perfil) {
        this.perfil = perfil;
    }

    public User [] getPesquisa() {
        return pesquisa;
    }

    public void setPesquisa(User [] pesquisa) {
        this.pesquisa = pesquisa;
    }

    public Status [] getTweets() {
        return tweets;
    }

    public void setTweets(Status [] tweets) {
        this.tweets = tweets;
    }

    public boolean isLog_ok() {
        return log_ok;
    }

    public void setLog_ok(boolean log_ok) {
        this.log_ok = log_ok;
    }

    public Status[] getListaTweets() {
        return listaTweets;
    }

    public void setListaTweets(Status[] listaTweets) {
        this.listaTweets = listaTweets;
    }

    public boolean isErro() {
        return erro;
    }

    public void setErro(boolean erro) {
        this.erro = erro;
    }

    public ArrayList<String> getBackup() {
        return backup;
    }

    public void setBackup(ArrayList<String> backup) {
        this.backup = backup;
    }

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FIM

    /*
     * Programas para controlar o array de menssagens
     */

    public void arrancaBackup(){
        backup = new ArrayList<String>();
    }

    public void adicionaSms(String mensagem){
        backup.add(mensagem);
    }

    public void limpaArray(){
        backup.clear();
    }

    /*
     * -----------------------------------------
     *      Metodos auxiliares
     * -----------------------------------------
     */

    public User pesquisaUser(String nome){
        User encontra = new User();

        for(int i=0; i<pesquisa.length; i++){
            encontra = pesquisa[i];
            if(encontra.getScreenName().equals(nome)){
                return encontra;
            }
        }
        return null;
    }

    public void setOAuthToken(String token){
        this.token = token;
    }

    public void setOAuthTokenSecret(String tokenSecret){
        this.tokenSecret = tokenSecret;
    }

    public String getOAuthToken(){
        return this.token;
    }

    public String getOAuthTokenSecret(){
        return this.tokenSecret;
    }
}
